#!/usr/bin/env node

const msg = 'd2FuZ2Rpbmc6MTIzNDU2'; 

// jpg binary image file ===> base64 string

const fs = require('fs'),
      http = require('http');

const buf = fs.readFileSync('./qr-code.jpg');
const img_base64 = (buf.toString('base64'));
const html = `<!doctype html><html><body><img src="data:image/jpg;base64,${img_base64}"></body>`;

http.createServer((req, res) => {
  res.end(html);
}).listen(8080);
